/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"1A50F4D8-7B42-4048-B85A-80E05D4E8FA2"}
 */
function iraDetalle(event) {
	forms.productos_detalle.controller.loadRecords(producto_id)
	globals.show('productos_detalle')
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"21F32A61-BE2B-45E5-8405-1EFFBE60E62B"}
 */
function menorPrecio(event) {
	ordenar('asc')
	negrita('lbl_menor_precio','lbl_mayor_precio')
}


/**
 * @properties={typeid:24,uuid:"16952ED1-45A1-4BE2-A61F-9BD195669A5F"}
 */
function negrita(negro,normal) {
	var $font = elements[normal].font
	var $letra = $font.substring(0, $font.indexOf(',',0)+1)
	$letra += '0' + $font.substring($font.lastIndexOf(',',$font.length), $font.length)
	elements[normal].font = $letra
	$font = elements[negro].font
	$letra = $font.substring(0, $font.indexOf(',',0)+1)
	$letra += '1' + $font.substring($font.lastIndexOf(',',$font.length), $font.length)
	elements[negro].font = $letra
}
/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"864211BC-F2C7-4CA2-B061-0208F6C6897D"}
 */
function mayorPrecio(event) {
	ordenar('desc')
	negrita('lbl_mayor_precio','lbl_menor_precio')
}

/**
 * // TODO generated, please specify type and doc for the params
 * @param {String} direccion
 *
 * @properties={typeid:24,uuid:"BA6EB3DD-3144-4D9D-BD21-D7CE181B13B6"}
 */
function ordenar(direccion)
{
	controller.sort('precio_unitario '+ direccion)
}
